package com.example.demo.api;

import com.example.demo.dto.DdxxAddInputDTO;
import com.example.demo.dto.DdxxQueryParam;
import com.example.demo.dto.DdxxQueryResult;
import com.example.demo.service.DdxxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ricky
 * @date 2022/1/28
 */
@Api(tags = "订单信息")
@RestController
@RequestMapping("/ddxx")
public class DdxxController {

    @Resource
    private DdxxService ddxxService;

    @ApiOperation("添加订单信息")
    @PostMapping("/addDdxx")
    public String addDdxx(@RequestBody @Validated DdxxAddInputDTO inputDTO) {
        return ddxxService.addDdxx(inputDTO);
    }

    @ApiOperation("查询订单信息")
    @PostMapping("/queryDdxx")
    public List<DdxxQueryResult> queryDdxx(@RequestBody @Validated DdxxQueryParam inputDTO) {
        return ddxxService.queryDdxx(inputDTO);
    }
}
